<?php
namespace Plugin\Attractions\Commerce\Schema\Commerce_qualification;

use Plugin\Attractions\Commerce\Model\Commerce_qualification\CommerceQualification;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 商户资质信息
 */
#[Schema(title: 'CommerceQualificationSchema')]
class CommerceQualificationSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: '主键ID', type: 'bigint')]
    public string $id;

    #[Property(property: 'merchant_id', title: '商户ID', type: 'bigint')]
    public string $merchant_id;

    #[Property(property: 'qualification_type', title: '资质类型：1-食品经营许可证，2-卫生许可证，3-消防许可证，4-其他证书', type: 'tinyint')]
    public string $qualification_type;

    #[Property(property: 'qualification_name', title: '资质名称', type: 'varchar')]
    public string $qualification_name;

    #[Property(property: 'qualification_id', title: '资质证书号', type: 'varchar')]
    public string $qualification_id;

    #[Property(property: 'issuing_authority', title: '发证机关', type: 'varchar')]
    public string $issuing_authority;

    #[Property(property: 'issue_date', title: '发证日期', type: 'date')]
    public string $issue_date;

    #[Property(property: 'expiry_date', title: '有效期至', type: 'date')]
    public string $expiry_date;

    #[Property(property: 'qualification_file', title: '资质文件路径', type: 'varchar')]
    public string $qualification_file;

    #[Property(property: 'remark', title: '备注', type: 'varchar')]
    public string $remark;




    public function __construct(CommerceQualification $model)
    {
       $this->id = $model->id;
       $this->merchant_id = $model->merchant_id;
       $this->qualification_type = $model->qualification_type;
       $this->qualification_name = $model->qualification_name;
       $this->qualification_id = $model->qualification_id;
       $this->issuing_authority = $model->issuing_authority;
       $this->issue_date = $model->issue_date;
       $this->expiry_date = $model->expiry_date;
       $this->qualification_file = $model->qualification_file;
       $this->remark = $model->remark;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'merchant_id' => $this->merchant_id ,'qualification_type' => $this->qualification_type ,'qualification_name' => $this->qualification_name ,'qualification_id' => $this->qualification_id ,'issuing_authority' => $this->issuing_authority ,'issue_date' => $this->issue_date ,'expiry_date' => $this->expiry_date ,'qualification_file' => $this->qualification_file ,'remark' => $this->remark];
    }
}